import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'


const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/article/editor',
    name: 'editor',
    component: () => import('../views/Editor.vue')
  },

  {
    path: '/article',
    name: 'article',
    component: () => import('../views/ArticleView.vue')
  },

  {
    path: '/faq',
    name: 'faq',
    component: () => import('../views/FaqView.vue')
  },

  {
    path: '/faq/editor',
    name: 'faqEditor',
    component: () => import('../views/FaqEditor.vue')
  },

  {
    path: '/detail',
    name: 'detail',
    component: () => import('../views/DetailView.vue'),

  },

  {
    path: '/user',
    name: 'user',
    component: () => import('../views/UserView.vue')
  },

  {
    path: '/search',
    name: 'search',
    component: () => import('../views/SearchView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
